
public class Test3 {
    public static void main(String[] args) {
        Cat cat = new Cat();
        Animal animal = cat;
        Dog dog = (Dog) animal; //编译失败，会抛出报错
        cat = (Cat) animal;

    }
}
